import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from Base import Base
class Page(Base):
    jin_fram=(By.XPATH,'//iframe[starts-with(@id,"x-URS-iframe175")]')
    def jin(self):
        self.jinframe(self.jin_fram)
    username_loc=(By.NAME,'email')
    def username(self,username):
        self.send_keys(self.username_loc,username)
    password_loc=(By.NAME,'password')
    def password(self,password):
        self.send_keys(self.password_loc,password)
    login_loc=(By.ID,'dologin')
    def login(self):
        self.click(self.login_loc)
    xiexin_loc=(By.XPATH,'/html/body/div[1]/nav/div[1]/ul/li[2]/span[2]')
    def xiexin(self):
        self.click(self.xiexin_loc)
    shoujian_loc=(By.CLASS_NAME,'nui-editableAddr-ipt')
    def shouian(self):
        self.send_keys(self.shoujian_loc,'2871590017@qq.com')
    zhuti_loc=(By.XPATH,'//input[contains(@id,"_subjectInput")]')
    def zhuti(self):
        self.send_keys(self.zhuti_loc,'126Web端自动化测试')
    jinneirong_loc=(By.CLASS_NAME,'APP-editor-iframe')
    def jinneirong(self):
        self.jinframe(self.jinneirong_loc)

    neirong_loc=(By.XPATH,'/html/body')
    def neirong(self):
        self.send_keys(self.neirong_loc,'喵喵喵喵')
    fasong_loc=(By.XPATH,'/html/body/div[2]/div[1]/div[2]/header/div/div[1]/div/span[2]')
    def fasong(self):
        self.click(self.fasong_loc)
    def test_126_login(self,username,password):
        self.jin()
        self.username(username)
        self.password(password)
        self.login()
        time.sleep(10)
        self.tuiframe()
        time.sleep(5)
        self.xiexin()
        time.sleep(2)
        self.shouian()
        self.zhuti()
        self.jinneirong()
        self.neirong()
        self.tuiframe()
        time.sleep(3)
        self.fasong()
        time.sleep(8)






